
<extend name="Public/layout"/>
<block name="head">
<link rel="stylesheet" href="__PUBLIC__css/reset.css?t=<?php echo time();?>">
<link rel="stylesheet" href="__PUBLIC__css/new-video-list.css?t=<?php echo time();?>">
<link rel="stylesheet" href="__PUBLIC__css/common.css?t=<?php echo time();?>">
<style>
body{
  background: #fff !important;
}
.footer{
  display: none;
}
</style>
</block>
    
<block name="main">
    <div class="lr_nb">  
        <div class="slider_wrap line">  
            <div class="wx_items">  
                <div class="item_cell <if condition='$_GET[id] eq 8'>active</if>">  
                    <span onclick="location.href='/Home/video/program/id/8'">网贷早报</span>  
                </div>   
                <div class="item_cell <if condition='$_GET[id] eq 14'>active</if>">  
                    <span  onclick="location.href='/Home/video/program/id/14'">平台走访</span>  
                </div>  
                <div class="item_cell <if condition='$_GET[id] eq 13'>active</if>">  
                    <span onclick="location.href='/Home/video/program/id/13'">网贷风云榜</span>  
                </div>  
                <div class="item_cell <if condition='$_GET[id] eq 11'>active</if>">  
                    <span onclick="location.href='/Home/video/program/id/11'">理财学堂</span>  
                </div>  
                <div class="item_cell <if condition='$_GET[id] eq 15'>active</if>">  
                    <span onclick="location.href='/Home/video/program/id/15'">网贷人物专访</span>  
                </div>   
            </div>  
         </div>  
    </div> 
    <!-- 视频 -->
<div class="video-item">
    <div class="common-banner school_content">
        <a href="/Home/Video/video_info/id/{$list.0.id}/type/2">
            <div class="video-img">
                <img <notempty name="list[0][wx_pic]">src="{$list.0.wx_pic}"<else/>src="{$list.0.pic}"</notempty>>
                <div class="common-detail">
                  <p>播放:{$list.0.play_count}
                      <span>{$$list.0.add_time|date="Y-m-d",###}</span>
                  </p>
                </div>
            </div>
            <div class="video-title">{$list.0.title}</div>
        </a>        
    </div>
    <div class="common-slider">
        <div class="common-swiper-container">
            <div class="common-swiper-wrapper school_list">

              <foreach name="list" item="v" key="k">
              <if condition="$k neq 0">
                <div class="common-swiper-slide">
                    <a href="/Home/Video/video_info/id/{$v.id}/type/2">
                        <div class="video-img">
                            <img <notempty name="v[wx_pic]">src="{$v.wx_pic}"<else/>src="{$v.pic}"</notempty> alt="">
                            <div class="common-detail">
                              <p>播放:{$v.play_count}
                                  <span>{$v.add_time|date="Y-m-d",###}</span>
                              </p>
                            </div>
                        </div>
                        <div class="video-title">{:msubstr($v['title'],0,20)}</div>
                    </a>                    
                </div>
              </if>
              </foreach>  
            </div>
        </div>
    </div>
    <div class="loading"> 
      <span class="loading-left"></span>
      <p>加载中</p>
      <span class="loading-right"></span>
    </div>
    <div class="base-line">
      <span class="base-left"></span>
      <p>我是有底线的</p>
      <span class="base-right"></span>
    </div>  
</div>
</block>

<script src="__PUBLIC__js/index.js"></script>
<block name="js"> 
     <script type="text/javascript">
        var p =0;
        var id ="{$_GET['id']}";
        var is_true = true;
    $(window).scroll(function() {
      if(is_true){
        if($(document).scrollTop()==$(document).height()-$(window).height()){
            $('.loading').css('display','block');
            p=p+1;
            setTimeout(function(){get_con(p)},1)
        }
      }
      

 });
 function get_con(p){
    $.post('/Home/Video/ajax_get_program/id/'+id,{
                p:p,
            },function(res){
			console.log(res)
                var h=''
                if(res[0]){
                    $(res).each(function(i,v){
                          h+='<div class="common-swiper-slide">'
                          h+='<a href="/Home/Video/video_info/id/'+v.id+'/type/2"> '
                          h+='<div class="video-img">'
                          if(v.wx_pic){
                           h+='<img src="'+v.wx_pic+'" alt="">'
                          }else{
                           h+='<img src="'+v.pic+'" alt="">'
                          }
                          h+='<div class="common-detail">'
                          h+='<p>播放:'+v.play_count
                          h+='<span>'+v.add_date+'</span>'
                          h+='</p>'
                          h+='</div>'
                          h+='</div>'
                          h+='<div class="video-title">'+v.title+'</div>'
                          h+='</a>'
                          h+='</div>'
                    })
                     $('.school_list').append(h)
                }else{
                    is_true = false;
                     $('.base-line').css('display','block');
                    $('.loading').css('display','none');
                }
                
               
            })

 }
 $(function(){ 
  var id = "{$_GET['id']}"
   if( id == 15 ){
        $(".slider_wrap").animate({scrollLeft: 250}, 800);
   } 
 })
/*
	$(window).scroll(function() {
      var h = $('.tabs').offset().top- $(window).scrollTop()
     // console.log(h)
      if(h<0){
        $('.tabs').css('position','fixed');
      }
  
      if($(window).scrollTop() == 0){
        $('.tabs').css('position','');
      }
    });*/
    </script>
  
</block>